feat: supported multiple rows update for sharding key update#1109
feat: supported multiple rows update for sharding key update#1109yogesh1801 wants to merge 3 commits into
Conversation
|
Apparently it was easy. Could you include some test coverage? |
|
@levkk 2 problems what i face is
|
You should still be able to validate that each row matches the original shard - just loop over the results and perform the same check we do for one row. The only difference is all checks have to pass, or we fallback to the insert/delete workflow.
You can do this instead: UPDATE ... SET id = 5 WHERE true;(it was 10 before, or an ID that matches a different shard actually). |
Thought of this but how likely is this case that all of them belong to same bag?, though there is no harm in checking all rows and see if they all match the same shard since it will be a quick check. |
Could be high, e.g.: UPDATE users SET tenant_id = 7 WHERE user_id IN ($1);That's going to return a lot of rows but if they belong to the same tenant in the first place, and the new tenant_id is on the same shard, we could save ourselves a lot of work. |
|
@levkk have added the above suggestion could you review |
|
not sure, why tests failing Ok they passed :) |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
No description provided.